<script setup lang="ts">
import { computed } from 'vue';

import { ConfigProvider } from 'ant-design-vue';
import themeSelf from '../src/setting/themeSelf';
import Header from './components/Header.vue';
import Footer from './components/Footer.vue';

//把英文改为中文
import zhCN from 'ant-design-vue/es/locale/zh_CN';

import dayjs from 'dayjs';

import 'dayjs/locale/zh-cn';

dayjs.locale('zh-cn');

const locale = ref()
locale.value = zhCN

const themeConfig = computed(() =>
  Object.assign({
    token: {
      colorPrimary: themeSelf.colorPrimary,
      colorSuccess: themeSelf.colorSuccess,
      colorWarning: themeSelf.colorWarning,
      colorError: themeSelf.colorError,
      colorInfo: themeSelf.colorInfo,
      fontFamily: themeSelf.fontFamily,
    },
  })
);
</script>

<template>
  <ConfigProvider :theme="themeConfig" :locale="locale">
    <Header></Header>
    <router-view></router-view>
    <Footer></Footer>
  </ConfigProvider>
</template>

<style scoped>
/* 阿里字体图标设置 */
.icon,
.iconfont {
  font-family: 'iconfont' !important;
  font-size: 16px;
  font-style: normal;
  -webkit-font-smoothing: antialiased;
  -webkit-text-stroke-width: 0.2px;
  -moz-osx-font-smoothing: grayscale;
}
</style>
<style lang="scss">
@font-face {
  font-family: 'pingfang';
  src: url('./assets/iconfont/PingFangSC.otf');
}

body,
#app {
  font-family: 'pingfang';
  overflow: auto;
  overflow-x: hidden;
  background: #f5f7fb;
}
</style>
